//
//  MediaSelectCell.m
//  yameishe3
//
//  Created by pro on 2017/3/8.
//  Copyright © 2017年 yameishe. All rights reserved.
//

#import "MediaSelectCell.h"
@interface MediaSelectCell ()
{
    __weak IBOutlet UILabel *nameLab;
    __weak IBOutlet UILabel *priceLab;
    __weak IBOutlet UILabel *descLab;
    
    
    __weak IBOutlet UIImageView *iconImgView;
    __weak IBOutlet UIButton *deleteBtn;//点击查看入口示意图
}
@end
@implementation MediaSelectCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setSource:(YMSMediaSource *)source
{
    _source = source;
    nameLab.text = source.media_name;
    priceLab.text = [NSString stringWithFormat:@"%.2f元",[source.mb_price floatValue]];
    [iconImgView downloadProductImageUrl:source.diagram_img];
}

-(IBAction)onTouchDelete:(id)sender
{
    if (_callbackDidDelete) {
        _callbackDidDelete(_source);
    }
}
@end
